Felix Su' Blog

从svn 迁移至 git

从svn 迁移至 git

  1. 先登录git管理页面,创建仓库 work

  2. 在本地任意目录下用终端工具执行

    1
    git svn clone http://svn.com/work --no-metadata work

    结束后目录下会多出一个名为work目录

    若下载过程出现中断,执行

    1
    git svn fetch
  3. 进入work目录,新增git远程分支地址,执行

    1
    git remote add origin http://git.com/work.git
  4. 将本地的 Git repo push 到远程仓库

  5. 1
    git push origin --all

    push 所有的 branch:

    1
    `git push origin --all`

    push 所有的 tag:

    1
    `git push origin --tags`